<?php
/*
whmtools - easily find accounts on cpanels servers
Copyright (C) 2006  Matthew Davis <matthew@familycampground.org>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

include 'header.php';
include 'config.php';

$sql = 'SELECT id, hostname, ip, username, hash, network, local_remote from servers order by hostname';
$query = mysql_query($sql);

print "<table>\n";
print "<tr><th>ID</th><th>Server Name</th><th>IP</th><th>User Name</th><th>Hash</th><th>Network</th><th>Local/Remote Query</th></tr>\n";
while ($servers = mysql_fetch_row($query)) {
  $id = $servers[0];
  foreach ($servers as $value) {
    $split_value = split("\n",$value);
    print "<td><a href=\"modify-server.php?id=$id\">" . $split_value[0] . "</a></td>";
  }
  print "</tr>";
}
print "</table>";
?>
